{extend name="public:layout" /}
{block name="title"}robots文件生成{/block}
{block name="head"}
{:widget('common/Form/validRes')}
{/block}
{block name="body"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox">
        <div class="ibox-title">
            <ol class="breadcrumb">
                <li><i class="fa fa-hand-o-right"></i>
                <li class="active">生成roots文件</li>
                </li>

            </ol>
        </div>
        <div class="ibox-content">
            <form method="post" class="form-horizontal" id="form">
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">禁止的搜索引擎</label>
                    <div class="col-sm-10">
                        <select name="User-agent-status" class="form-control" id="userstatus">
                            <option value="0" {eq name=":count($robots['User-agent'])" value="1" } selected {/eq}>允许全部</option>
                            <option value="1" {neq name=":count($robots['User-agent'])" value="1" } selected {/neq}>选择禁止</option>
                        </select>
                        <div id="User-agent" {eq name=":count($robots['User-agent'])" value="1" } style='display: none' {/eq}>
                        {volist name="botList" id="vo" key='k'}
                        <label class="checkbox-inline">
                            <input type="checkbox" name="User-agent[]" {in name="key" value="$robots['User-agent']" } checked  {/in} value="{$key}">
                            {$vo.name}
                        </label>
                        {/volist}
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label Validform_label">禁止搜索的模块</label>
                <div class="col-sm-10">
                    {volist name="sysDir" id="vo"}
                    <label class="checkbox-inline">
                        <input type="checkbox" name="Disallow[]" {in name="vo" value="$robots['Disallow']"} checked {/in} value="{$vo}">
                        {$key}
                    </label>
                    {/volist}
                </div>
            </div>
        <div class="form-group">
            <label class="col-sm-2 control-label Validform_label">Sitemap地址</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" name="Sitemap" value="{$robots['Sitemap'][0]}">
            </div>
        </div>
            <div class="form-group">
                <div class="col-sm-10 col-sm-offset-2">
                    <button class="btn btn-primary"
                            onclick="ajaxSubForm();" type="submit">
                        保存内容
                    </button>
                    <a href="{:url('index')}" class="btn btn-white">取消</a>
                    <span id="validError"></span>
                </div>
            </div>
        </form>
    </div>
</div>
{literal}
<script id="itemListTpl" type="text/html">
    {{each list as value i}}
    <tr>
        <td><input type="text" class="form-control itemKey" name="item[{{i}}][item_key]" value="{{value.item_key}}"/>
        </td>
        <td><input type="text" class="form-control" name="item[{{i}}][item_value]" value="{{value.item_value}}"/></td>
        <td><a href="javascript:;" onclick="del(this)">删除</a></td>
    </tr>
    {{/each}}
</script>
{/literal}
{/block}
{block name="script"}
<script>
    $('#userstatus').change(function () {
        var status = $(this).val();
        if (parseInt(status)) {
            $('#User-agent').show();
        } else {
            $('#User-agent').hide();
        }
    })
</script>
{/block}